﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Jay.Sc2.Bof.Lib.Tools
{
	public class Cost
	{

		public Cost(double minerals, double gas, double time)
		{
			Minerals = minerals;
			Gas = gas;
			Time = time;
		}
		public double Minerals;
		public double Gas;
		public double Time;
		public void Add(double minerals, double gas, double time)
		{
			Minerals += minerals;
			Gas += gas;
			Time += time;
		}
		public void Add(Cost cost) { Add(cost.Minerals, cost.Gas, cost.Time); }
		public bool IsInferiorOrEqualsCost(Cost other)
		{
			return Minerals <= other.Minerals && Gas <= other.Gas && Time <= other.Gas;
		}
		public override string ToString()
		{
			return "[M=" + Minerals.ToString("0") + ";G=" + Gas.ToString("0") + ";T=" + Time.ToString("0") + "]";
		}

		internal void Multiply(double multiplier)
		{
			Minerals *= multiplier;
			Gas *= multiplier;
			Time *= multiplier;
		}
	}
}
